<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8"></meta>
  <%= stylesheet_link_tag 'default' %>
  <%= stylesheet_link_tag 'order_print',:media=>"print" %>
  <%= javascript_include_tag 'jquery.js' %>
  <%= javascript_include_tag 'jquery.tools.min' %>
  <%= javascript_include_tag 'overlay' %>
  <title>TT小站::打印订单信息</title>
  <style type="text/css">
    body{background:none;}
  </style>
</head>

<body>

<% @orders.each do |o| %>
<table class="admin" border="1" style="margin: 30px auto;">
    <thead>
      <tr>
        <th colspan="5">TT小站 订单NO.<%=o.id%></th>
        <th><label>账户</label></th>
        <th><%=o.user.login%></th>
        <th><label>件数</label></th>
        <th><%=o.total_item%></th>
      </tr>
    </thead>
    <tbody>
      <% if o.line_items.length > 0 %>
        <tr>
          <td colspan="9"><label>设计列表</label></td>
        </tr>
        <tr>
          <td colspan="9" class="break">

          </td>
        </tr>
        <% i = 1 %>
        <% for li in o.line_items %>
          <% if li.product %>
            <tr>
              <td><%=i%></td>
              <td><label>衣服编号</label></td>
              <td><%=li.product.material.sn%></td>
              <td><label>尺寸:</label></td>
              <td><%= li.tee_size%></td>
              <td><label>图案编号</label></td>
              <td colspan="3"><%=li.product.designs_string%></td>
            </tr>
            <% i += 1 %>
          <%  end %>
        <% end %>



        <tr>
          <td colspan="9" class="break">

          </td>
        </tr>
      <% end %>
      <tr>
        <td colspan="2" ><label>下单时间</label></td>
        <td><span class="td_content"><%=o.created_at.strftime("%y-%m-%d %I:%M%p")%></span></td>
        <td ><label>订单状态</label></td>
        <td><span class="td_content"><%=format_status o.status if o.status%></span></td>
        <td><label>支付方式</label></td>
        <td><span class="td_content"><%=format_paytype o.paytype if o.paytype%></span></td>
        <td><label>衣服金额</label></td>
        <td><span class="yen"><%=o.total_product_price%></span></td>
      </tr>
      <tr>
        <td colspan="2"><label>物流方式</label></td>
        <td><span class="td_content"><%=o.logistic.name if o.logistic%></span></td>
        <td><label>物流单号</label></td>
        <td><%=o.logistics_order_no%></td>
        <td><label>物流费用</label></td>
        <td><span class="yen"><%= o.logistics_fee if o.logistic%></span></td>
        <td><label>总金额</label></td>
        <td><span class="yen"><%=o.total_price%></span></td>
      </tr>

      <tr>
        <td colspan="9" style="text-align:left;">
          <span class="td_content"><%=o.address.title if o.address %></span>
        </td>
      </tr>
      <%  if o.address %>
        <tr>
          <td colspan="9" style="text-align:left;">
            <span class="td_content">
              联系人：<%=o.address.receiver%> 联系电话：<%=o.address.tel%> <%=o.address.mobile %>
            </span>
          </td>
        </tr>
      <% end %>
      <tr>
        <td colspan="9" style="text-align:left;">
          <label>附言：</label><span class="td_content"><%=o.remark%></span>
        </td>
      </tr>
    </tbody>
  </table>
<%end%>

    <div class="apple_overlay" id="overlay">
      <!-- the external content is loaded inside this tag -->
      <div class="contentWrap" id="contentWrap"></div>
    </div>

<div class="print_button">


  <div class="action_link" style="width:70px; margin: 10px auto;">
    <input  type="button"  value="打印"   onclick="print();"  />
    <a href="javascript:window.close();">关闭</a>
  </div>

</div>
</body>
</html>